package cn.iocoder.yudao.module.erp.dal.mysql.finance.pay;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.erp.dal.dataobject.finance.pay.PayDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.erp.controller.admin.finance.pay.vo.*;

/**
 * 支付明细 Mapper
 *
 * @author 天使管理员
 */
@Mapper
public interface PayMapper extends BaseMapperX<PayDO> {

    default PageResult<PayDO> selectPage(PayPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PayDO>()
                .eqIfPresent(PayDO::getShipper, reqVO.getShipper())
                .eqIfPresent(PayDO::getTotalAmount, reqVO.getTotalAmount())
                .eqIfPresent(PayDO::getPayIdAmount, reqVO.getPayIdAmount())
                .betweenIfPresent(PayDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(PayDO::getNote, reqVO.getNote())
                .orderByDesc(PayDO::getId));
    }

}